/*
 * @Author: your name
 * @Date: 2021-11-29 16:25:35
 * @LastEditTime: 2021-11-29 17:00:05
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /dome_umi/src/pages/login/index.js
 */
import React from 'react'
import styles from '../index.scss'
import {Form, Input, Icon, Button} from 'antd'

const Login = ({form}) => {

    const handleClick = () => {
        form.validateFields(err => {
            if (!err) {
                // 请求
              fetch()
            }
        });
    }
    return (
        <div className={styles.logins}>
            登陆
            <Form>
                <Form.Item>
                {form.getFieldDecorator('username', {
                    rules: [
                    {
                        required: true,
                        message: 'Please input your name',
                    },
                    ],
                })(<Input placeholder="请输入账号" prefix={<Icon type="user"></Icon>}></Input>)}
                </Form.Item>
                <Form.Item>
                    {form.getFieldDecorator('password', {
                        rules: [
                            {
                                required: true,
                                message: 'Please input your password',
                            },
                        ],
                    })(<Input type="password" placeholder="请输入密码" prefix={<Icon type="calendar" />}></Input>)}
                    
                </Form.Item>
                <Form.Item>
                    <Button onClick={handleClick}>登陆</Button>
                </Form.Item>
            </Form>
        </div>
    )
}


export default Form.create()(Login)